package ${projectPackage}.biz.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.feeling.admin.base.core.CoreContext;
import com.feeling.admin.base.service.impl.BaseQueryService;
import com.feeling.admin.common.constants.BankDict;
import ${projectPackage}.dao.${modelName}Dao;
import ${projectPackage}.entity.${modelName};
import ${projectPackage}.model.${modelName}ListForm;
import com.feeling.flbase.common.util.BeanUtil;
import com.feeling.flbase.dao.model.Page;

/**
 * @author ${authName}
 * @date ${createDate}
 */
public class ${modelName}ListQueryServiceImpl extends BaseQueryService {
	@Autowired
	private ${modelName}Dao ${lowModelName}Dao;
	/* (non-Javadoc)
	 * @see com.feeling.admin.base.service.IQueryService#query(java.util.Map, com.feeling.admin.base.core.CoreContext)
	 */
	@Override
	public Map<String, ?> query(Map<String, ?> rq, CoreContext coreContext) {
		Map<String, Object> respMap=new HashMap<String, Object>();
		${modelName}ListForm listForm=(${modelName}ListForm)coreContext.getData(BankDict.REQUESTFORM);
		${modelName} entity=new ${modelName}();
		Page<${modelName}> page=new Page<${modelName}>();
		BeanUtil.bean2Bean(listForm, page);
		page=${lowModelName}Dao.queryForPageList(entity, page);
		List<${modelName}> list=page.getRows();
		respMap.put("records", list);
		respMap.put("total", page.getTotal());
		return respMap;
	}

}
